package com.tanhua.admin.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tanhua.model.domain.Analysis;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Service;

import java.util.Date;


public interface AnalysisMapper extends BaseMapper<Analysis> {
   @Select("select sum(num_active) from tb_analysis where record_date BETWEEN #{dateStr}  and #{format} ")
    Integer activePassMonth(@Param("format") String format , @Param("dateStr") String dateStr);
    @Select("select sum(num_active) from tb_analysis where record_date BETWEEN #{lastweek} and #{format}")
    Integer activePassWeek(@Param("format") String format,  @Param("lastweek")String lastweek);
@Select("SELECT num_registered FROM `tb_analysis` where record_date =#{date}")
    Integer newUsersToday(@Param("date")String date);

    Integer newUsersTodayRate(String format);
}
